/**
 * 
 */
package com.runningfox.Process;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

import com.runningfox.humor.AbstractProcess;
import com.runningfox.humor.Action;
import com.runningfox.humor.ProcessCallback;
import com.runningfox.logic.Logic;
import com.runningfox.model.Joke;
import com.runningfox.model.ResultSet;

/**
 * @author luhaiyang
 * request the detail page of joke with the joke id
 */
public class OldProcess extends AbstractProcess implements ProcessCallback{

	Joke node;
	public OldProcess(Handler handler,Joke node) {
		super(handler);
		// TODO Auto-generated constructor stub
		this.node=node;
	}

	/* (non-Javadoc)
	 * @see com.runningfox.Humor.AbstractProcess#run()
	 */
	@Override
	public void runImpl() {
		// TODO Auto-generated method stub
		Logic.reqeustDetail(this, node);
	}

	@Override
	public void onFailed(ResultSet res) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onHttp200() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onHttp404() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onHttp500() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onSucess(ResultSet res) {
		// TODO Auto-generated method stub
		Message msg = new Message();
		Bundle data = new Bundle();
		msg.what = Action.OLD;
		data.putString("res", res.old);
		msg.setData(data);
		handler.sendMessage(msg);
	}

	@Override
	public void onHttpFaild() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onParsing() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onParseFail() {
		// TODO Auto-generated method stub
		
	}

}
